﻿using System.Windows.Controls;
using GSSoftSL.Web;

namespace GSSoftSL.Views.NghiepVu
{
    /// <summary>
    /// Description for DiemDanhView.
    /// </summary>
    public partial class DiemDanhView : UserControl
    {
        private DiemDanhChonNgay _child;

        /// <summary>
        /// Initializes a new instance of the DiemDanhView class.
        /// </summary>
        public DiemDanhView()
        {
            InitializeComponent();
        }

        private void btnInfo_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (_child == null)
                _child = new DiemDanhChonNgay();
            _child.SetMode(EnumMode.AddNew);
            _child.Show();
        }

        private void btnEdit_Click(object sender, System.Windows.RoutedEventArgs e)
        {
        	// TODO: Add event handler implementation here.
            if (_child == null)
            {
                MessageWindow.CreateNew("Bạn vui lòng chọn 1 ngày điểm danh trước.");
                return;
            }
            _child.SetMode(EnumMode.Modified);
            _child.Show();
        }
    }
}